< previous page page_472 next page >

Page 472
Tip.gif
A good custom control also has a property page interface for setting control properties at design time. Because this is not a required feature, it has been left out of our custom control design so that you can concentrate on building the data-bound aspects of the control.

After you build and compile the find dialog custom control, you build a small data entry form that tests the new control.
The dbFind Control Button
The first step in the process is to start a new Visual Basic 5.0 ActiveX Control project. Name the project dbFindCtl and name the UserControl dbFind. Now add a single command button to the UserControl. Set its Height and Width properties to 315 and specify . . . as its caption property. Set the font properties to Arial, 8pt Bold. Refer to Figure 12.17 as a guide.
0472-01.jpg
Figure 12.17.
Setting up the dbFind button.
Once you have set these properties, save the control as DBFIND.CTL and the project as DBFINDCTL.VBP.
This custom control has six custom properties and two declared events. Open the code window for the dbFind control and add the code from Listing 12.5 to the general declarations section of the project.

 
< previous page page_472 next page >

If you like this book, buy it!